Merge "Change name of main page in Sardinian (sc)"
[lhc/web/wiklou.git] / tests / phpunit / documentation / ReleaseNotesTest.php
index 2789571..d8d0fdc 100644 (file)
@@ -41,8 +41,6 @@ class ReleaseNotesTest extends MediaWikiTestCase {
                }
        }
 
-       /**
-        */
        private function assertFileLength( $type, $fileName ) {
                $file = file( $fileName, FILE_IGNORE_NEW_LINES );
 
@@ -51,16 +49,13 @@ class ReleaseNotesTest extends MediaWikiTestCase {
                        "$type file '$fileName' is inaccessible."
                );
 
-               $lines = count( $file );
-
-               for ( $i = 0; $i < $lines; $i++ ) {
-                       $line = $file[$i];
-
+               foreach ( $file as $i => $line ) {
+                       $num = $i + 1;
                        $this->assertLessThanOrEqual(
                                // FILE_IGNORE_NEW_LINES drops the \n at the EOL, so max length is 80 not 81.
                                80,
                                mb_strlen( $line ),
-                               "$type file '$fileName' line $i is longer than 80 chars:\n\t'$line'"
+                               "$type file '$fileName' line $num, is longer than 80 chars:\n\t'$line'"
                        );
                }
        }